#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>

#define USER "USER"
#define MY_VAL "myval"

int main(int argc, char* argv[])
{
    for(int i = 0; i < argc; ++i)
    {
        printf("argv[%d]:%s\n", i, argv[i]);
    }

    /*
    char* myval = getenv(MY_VAL);

    if(NULL == myval)
    {
        printf("%s:not found\n", MY_VAL);
        return 1;
    }
    
    printf("%s=%s\n", MY_VAL, myval);
    /*
    /*
    char* user = getenv(USER);
    if(strcmp(user, "root") == 0)
    {
        printf("user:%s\n", user);
    }
    else
    {
        printf("权限不足\n");
    }
    */
    /*
    while(1)
    {
        printf("pid:%d\n", getpid());
        sleep(2);
    }
    */

    return 0;
}
